import axios from 'axios'

// 分页查询订单数据
export const queryOrder = (moduleId, params, pageNum, pageSize) => {
  return axios.post(`/api/orders/query/${moduleId}`, params, {
    params: {
      pageNum,
      pageSize
    }
  })
}

// 根据ID获取订单
export const getOrder = (id) => {
  return axios.get(`/api/orders/${id}`)
}

// 保存或更新订单
export const saveOrder = (order) => {
  return axios.post('/api/orders', order)
}

// 删除订单
export const deleteOrder = (id) => {
  return axios.delete(`/api/orders/${id}`)
}
